﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace ControllerLayer.MainView
{
    public class MainViewController
    {
        public static bool loadFlag;
        public static bool userLogOutFlag;

        public static string currentPatientName;
        public static string currentPID;
        public static string currentAccessionNumber;
        public static string selectedProcedureTypeName;
        public static ToolStripLabel nameLabel = null;

        public static bool changeView=false;

        public static string LoadFullnameLabel(Control fullNameLbl, Control familyNameLbl, Control givenNameLbl)
        {
            fullNameLbl.Text = familyNameLbl.Text + ", " + givenNameLbl.Text;
            familyNameLbl.Visible = false;
            givenNameLbl.Visible = false;
            currentPatientName = fullNameLbl.Text;
            return fullNameLbl.Text;
        }

        public static void LoadUpperDetailInformation(Control ageSexLbl, Control dobLbl, Control sexLbl)
        {
            string age;
            try
            {
                age = ((DateTime.Today - DateTime.Parse(dobLbl.Text)).Days / 365).ToString();              
            }
            catch
            {
                age = "-";
            }
            ageSexLbl.Text = age + " / " + sexLbl.Text;
            sexLbl.Visible = false;
        }

        public static void UpdateUserLabel(ToolStripItem toolStripItem,string name)
        {
            toolStripItem.Text = name;
        }
    }
}
